<div>
    <div th:fragment="messages">
        <div class="alert-box alert" th:switch="${errorCode}" th:unless="${#strings.isEmpty(errorCode)}">  
            <div th:case="'notFound'" th:text="#{password.notFound}" />
            <div th:case="'invalidUser'" th:text="#{password.invalidUser}" />
            <div th:case="'inactiveUser'" th:text="#{password.inactiveUser}" />
            <div th:case="'invalidToken'" th:text="#{password.invalidToken}" />
            <div th:case="'tokenExpired'" th:text="#{password.tokenExpired}" />
            <div th:case="'tokenUsed'" th:text="#{password.tokenUsed}" />
            <div th:case="'invalidPassword'" th:text="#{password.invalidPassword}" />
            <div th:case="'passwordMismatch'" th:text="#{password.passwordMismatch}" />
            <div th:case="*" th:inline="text">[[#{password.unknown}]] <span th:text="${errorCode}"/></div>
        </div>
        
        <div class="alert-box success" th:unless="${#strings.isEmpty(param.messageCode) and ! #strings.isEmpty(errorCode)}">            
            <div th:if="${param.messageCode[0] == 'passwordTokenSent'}" th:text="#{password.passwordTokenSent}" />
        </div>        
    </div>

    <blc:form th:fragment="form" action="#" th:action="@{/resetPassword}" method="post" class="form-horizontal" th:object="${resetPasswordForm}">
    
        <label th:text="#{password.username}" />
        <input type="text" id="username" name="username" autofocus="autofocus" class="twelve" th:field="*{username}"/>

        <label th:text="#{password.token}" />
        <input type="text" id="token" name="token" class="twelve" th:field="*{token}" />

        <label th:text="#{password.newPassword}" />
        <input type="password" id="password" name="password" class="twelve" th:field="*{password}" />

        <label th:text="#{password.confirmNewPassword}" />
        <input type="password" id="confirmPassword" name="confirmPassword" class="twelve" th:field="*{confirmPassword}" />
 
        <input type="submit" class="button radius right" value="Reset Password"/>
    </blc:form>
      
    
    <div th:fragment="options">
        <ul class="inline-list">
            <li><a href="#" th:href="@{/login}" th:text="#{password.login}" /></li>
            <li class="divider">&nbsp;</li>
            <li><a href="#" th:href="@{/forgotUsername}" th:text="#{password.forgotUsername}" /></li>
            <li class="divider">&nbsp;</li>
            <li><a href="#" th:href="@{/forgotPassword}" th:text="#{password.forgotPassword}" /></li>
        </ul>
    </div>
</div>